﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Inspired.Euler
{
    /// <summary>
    /// The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
    /// 
    /// Find the sum of all the primes below two million.
    /// </summary>
    public static class Problem010
    {
        /// <summary>
        /// Calculate the sum of all the primes below two million.
        /// </summary>
        [EulerProblem(10, Title = "Calculate the sum of all the primes below two million.")]
        public static long Solve()
        {
            return Extensions.GetPrimes().TakeWhile(i => i < 2000000).Sum();
        }
    }
}
